﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HFController;
namespace HFWebApp.FAQs
{
    public partial class askcontent : BagePages
    {
        public hf.Model.Ask model = null;
        public string PageStr = "";
        public List<hf.Model.Answer> list = new List<hf.Model.Answer>();
        public hf.Model.User user = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = this.GetQuery("id");
            if (id != "")
            {
                user = this.getLoginAccount();
                model = AskController.getController().getAskModel(int.Parse(id));
                //每页5条答案
                //绑定答案ID
                int PageSize = 5;
                int PageNumber = 1;
                if (this.GetQuery("Page") != "")
                {
                    PageNumber = int.Parse(this.GetQuery("Page"));
                }
                int total = 0;
                string strWhere = "AskID=" + model.ID.ToString();
                list = AnswerController.getController().getAnswerList(PageSize, PageNumber, strWhere, out total);
                PageStr = LLL.Pager.TrunPageHtmlCode_Web(PageSize, PageNumber, total, "");
                /*
                Repeater1.DataSource = AnswerController.getController().getAnswerList(PageSize ,PageNumber ,strWhere ,out total);
                Repeater1.DataBind();
                 * */
            }
            else {
                Response.Write("参数错误");
                Response.End();
            }
        }
    }
}